package net.comm.user.web.form;

import net.comm.page.PageCtr;

import org.apache.struts.action.*;


public class ContactsForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private static final String KEY_SPLIT = "#,##,#,#,#";

	private int  	UserID;		//会员ID
	private String  Offwebsite;	//官方网址
	private String  Perwebsite;	//个人网址
	private String  Blog;		//个人博客
	private String  Mobile;		//手机
	private String  Tel;		//商务电话
	private String  Famtel;		//家庭电话
	private String  Fax;		//传真号码
	private String  QQ;			//
	private String  Msn;		//
	private String  Email;		//Email
	private String  Addr;		//通讯地址
	private String  Postcode;	//邮编
	private String  MTime;		//	
	
	
	public ContactsForm() {
		super();
		// TODO Auto-generated constructor stub
		UserID = 0;
		Offwebsite = "";
		Perwebsite = "";
		Blog = "";
		Mobile = "";
		Tel = "";
		Famtel = "";
		Fax = "";
		QQ = "";
		Msn = "";
		Email = "";
		Addr = "";
		Postcode = "";
		MTime = "";
		
		action = "";
	}

	private String action = "";
	
	/**
	 * 查询当前页主键值串
	 */
	private String key = "";

	/**
	 * 查询上上页主键值串
	 */
	private String lastKey = "";
	

	/**
	 * 分页控制对象
	 */
	private PageCtr page;
	



	public PageCtr getPage() {
		return page;
	}

	public void setPage(PageCtr page) {
		this.page = page;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String[] array) {
		if(key != null && key.trim().length() > 0) {
			key = "";
		}
		
		StringBuffer keyBuff = new StringBuffer();
		for (int i = 0; i < array.length; i++) 
		{
			/**
			 * 防止空字符串引起的split方法异常
			 */
			if(array[i] == null || array[i].length() == 0) {
				keyBuff.append(" ");
			} else {
				keyBuff.append(array[i]);
			}
			
			keyBuff.append(KEY_SPLIT);
		}
		
		key = keyBuff.toString();		
	}
	
	/**
	 * 获取lastKey值
	 * @return
	 */
	public String[] lastKey()
	{
		if(lastKey == null || lastKey.trim().length() == 0) {
			return null;
		}
		
		return lastKey.split(KEY_SPLIT);
	}
	
	public String getLastKey() {
		return lastKey;
	}

	public void setLastKey(String lastKey) {
		this.lastKey = lastKey;
	}	

	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}

	public static String getKEY_SPLIT() {
		return KEY_SPLIT;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public int getUserID() {
		return UserID;
	}

	public void setUserID(int userID) {
		UserID = userID;
	}

	public String getOffwebsite() {
		return Offwebsite;
	}

	public void setOffwebsite(String offwebsite) {
		Offwebsite = offwebsite;
	}

	public String getPerwebsite() {
		return Perwebsite;
	}

	public void setPerwebsite(String perwebsite) {
		Perwebsite = perwebsite;
	}

	public String getBlog() {
		return Blog;
	}

	public void setBlog(String blog) {
		Blog = blog;
	}

	public String getMobile() {
		return Mobile;
	}

	public void setMobile(String mobile) {
		Mobile = mobile;
	}

	public String getTel() {
		return Tel;
	}

	public void setTel(String tel) {
		Tel = tel;
	}

	public String getFamtel() {
		return Famtel;
	}

	public void setFamtel(String famtel) {
		Famtel = famtel;
	}

	public String getFax() {
		return Fax;
	}

	public void setFax(String fax) {
		Fax = fax;
	}

	public String getQQ() {
		return QQ;
	}

	public void setQQ(String qq) {
		QQ = qq;
	}

	public String getMsn() {
		return Msn;
	}

	public void setMsn(String msn) {
		Msn = msn;
	}

	public String getAddr() {
		return Addr;
	}

	public void setAddr(String addr) {
		Addr = addr;
	}

	public String getPostcode() {
		return Postcode;
	}

	public void setPostcode(String postcode) {
		Postcode = postcode;
	}

	public String getMTime() {
		return MTime;
	}

	public void setMTime(String time) {
		MTime = time;
	}

	public String getEmail() {
		return Email;
	}

	public void setEmail(String email) {
		Email = email;
	}



	
}